//
//  uiCommon.h
//  smu_test1
//
//  Created by jiayi on 16/9/26.
//
//

#ifndef uiCommon_h
#define uiCommon_h

#include "smuCommon.hpp"
#include "cocos2d.h"
#include "extensions/cocos-ext.h"
#include "ui/CocosGUI.h"

#include "smuNode.h"
#include "uiDefines.h"
#include "uiFactory.h"
#include "uiDoubleClickChecker.h"
#include "uiNode.h"
#include "uiNodeManager.h"

#endif /* uiCommon_h */

#define uiCreate( class )\
public:\
static class* create(){ \
auto ret = new (std::nothrow) class; \
if (ret) \
{\
    ret->autorelease();\
}\
return ret;}\

#define uiCreateInit( class )\
public:\
static class* create(){\
class * ret = new (std::nothrow) class();\
if (ret && ret->init())\
{\
    ret->autorelease();\
}\
else\
{\
    CC_SAFE_DELETE(ret);\
}\
return ret;}\

#define uiDelete( ui )\
if( ui ){\
    ui->release(); \
    ui = nullptr; \
}\

#define defVector( class ) \
typedef Vector< class* > class##s; \
typedef class##s::iterator class##s##Iter; \
typedef class##s::const_iterator class##s##ConstIter; \
